package reflect;


import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Test {
    public static void main(String[] args) throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException {
        Class cla = Class.forName("reflect.Student");
        Constructor con = cla.getConstructor(String.class , int.class , char.class);
        Object obj = con.newInstance("小明" , 18 , '男');
        System.out.println(obj);
        Constructor con1 = cla.getConstructor();
        Object obj1 = con1.newInstance();
        System.out.println(obj1);
    }
}
